<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>赤峰汇潮</title>
  <meta name="description" content="这是一个 index 页面">
  <meta name="keywords" content="index">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <!-- css文件 -->
  {include file="public/title" /}
</head>
<body data-type="generalComponents">
  <!-- 头部 -->
  {include file="public/header" /}
  <div class="tpl-page-container tpl-page-header-fixed">
    <!-- 左侧导航 -->
    {include file="public/leftNav" /}
    <div class="tpl-content-wrapper">
      <ol class="am-breadcrumb">
        <li><a href="#" class="am-icon-home">首页</a></li>
        <li><a href="#">友情链接</a></li>
        <li class="am-active">链接列表</li>
      </ol>
      <div class="tpl-portlet-components">
        <div class="tpl-block">
          <div class="am-g">
            <div class="am-u-sm-12 am-u-md-6">
              <div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                  <button type="button" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span>
                    新增</button>
                  <button type="button" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span>
                    批量删除</button>
                </div>
              </div>
            </div>
            <div class="am-u-sm-12 am-u-md-3">
              <div class="am-form-group">
                <select data-am-selected="{btnSize: 'sm'}">
                  <option value="option1">所有类别</option>
                  <option value="option2">顶级栏目</option>
                  <option value="option3">二级栏目</option>
                </select>
              </div>
            </div>
            <div class="am-u-sm-12 am-u-md-3">
              <div class="am-input-group am-input-group-sm">
                <input type="text" class="am-form-field">
                <span class="am-input-group-btn">
                  <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="button"></button>
                </span>
              </div>
            </div>
          </div>
          <div class="am-g">
            <div class="am-u-sm-12">
              <table class="am-table am-table-striped am-table-hover table-main">
                <thead>
                  <tr>
                    <th class="table-check" width="5%"><input type="checkbox" class="tpl-table-fz-check"></th>
                    <th class="table-id" width="5%">ID</th>
                    <th class="table-title" width="10%">缩略图</th>
                    <th class="table-title" width="15%">标题名称</th>
                    <th class="table-title" width="15%">英文名称</th>
                    <th class="table-title" width="30%">描述</th>
                    <th class="table-set" width="20%">操作</th>
                  </tr>
                </thead>
                <tbody>
                {volist name="Count" id="vo"}
                  <tr>
                    <td><input type="checkbox"></td>
                    <td>{$vo.id}</td>
                    <td><a href="#">
                      {if condition="$vo['pic'] neq ''"}
                      <img src="{$vo.pic}" width="100%" alt="">
                      {else /}
                      暂无缩略图
                      {/if}
                    </a></td>
                    <td>{$vo.title}</td>
                    <td><a href="###">{$vo.enname}</a></td>
                    <td>{$vo.desc}</td>
                    <td>
                      <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <a href="{:url('edit',['id'=>$vo.id])}"><button class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span>
                            编辑</button></a>
                            <a href="javascript:void(0);" onclick="del(this,{$vo.id})"><button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span
                              class="am-icon-trash-o"></span>
                            删除</button></a>
                        </div>
                      </div>
                    </td>
                  </tr>
                {/volist}
                </tbody>
              </table>
              <script>

                /**
                  * ajax单条删除
                  */
                function del(obj,id){
                  $.post("{:url('count/del')}",{id:id},function(data){
                    if(data.statu==200){
                      layer.alert(data.info, {icon: 6});
                      $(obj).parent().parent().parent().parent().remove();
                    }else{
                      layer.alert(data.info, {icon: 5});
                    }
                  })
                }
              </script>
              <div class="am-cf">
                <div class="am-fr">
                  <!-- 分页 -->
                  {$Count->render()}
                </div>
              </div>
              <hr>
            </div>
          </div>
        </div>
        <div class="tpl-alert"></div>
      </div>
    </div>
  </div>
  <!-- js -->
  {include file="public/foot" /}
</body>

</html>